package ss.pku.jsa.type.io;

import java.io.IOException;

public class ReaderApp {
	public static void main(String[] args) {
		String eclipseHome = System.getenv("ECLIPSE_HOME");
		String filename = "jqual_input";
		AnnotationStore store = null;
		try {
			store = new AnnotationReader(eclipseHome + "/" + filename)
					.readAll();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}

		MethodQSig m = store.getMethod("Ljdbm/recman/PhysicalRowIdManager;",
				"update", "(Ljdbm/recman/Location;[BII)Ljdbm/recman/Location;");
		if (m == null) {
			System.err.println("Could not find update()");
		} else {
			System.out.println(m);
			boolean[] tracked = m.tracked();
			System.out.print("[ ");
			for (boolean b : tracked)
				System.out.print(b + " ");
			System.out.println("]\n");
		}

		FieldQSig f = store.getField("Ljdbm/recman/Location;", "block");
		if (f == null) {
			System.err.println("Could not find block");
		} else {
			System.out.println(f);
			System.out.println("tracked? " + f.isTracked());
		}
	}
}